<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>who</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_2885">&nbsp;</a>NAME</h4><blockquote>
who - display who is on the system
</blockquote><h4><a name = "tag_001_014_2886">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

who <b>[</b>-mu<b>]</b>-s<b>[</b>-bHlprt<b>][</b><i>file</i><b>]</b>

who <b>[</b>-mTu<b>][</b>-abdHlprt<b>][</b><i>file</i><b>]</b>

who -q <b>[</b><i>file</i><b>]</b>

who am i

who am I
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_2887">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>who</i>
utility lists various pieces of information about accessible users.
The domain of accessibility is implementation-dependent.
<p>
Based on the options given,
<i>who</i>
also can list the user's name, terminal line, login time,
elapsed time since activity occurred on the line
and the process ID of the command interpreter
for each current system user.
</blockquote><h4><a name = "tag_001_014_2888">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>who</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .
<p>
The following options are supported.
The metavariables, such as
&lt;<i>line</i>&gt;,
refer to fields described in the STDOUT section.
<dl compact>

<dt><b>-a</b>
<dd>Process the implementation-dependent database or named file with the
<b>-b</b>,
<b>-d</b>,
<b>-l</b>,
<b>-p</b>,
<b>-r</b>,
<b>-t</b>,
<b>-T</b>
and
<b>-u</b>
options turned on.

<dt><b>-b</b>
<dd>Write the time and date of the last reboot.

<dt><b>-d</b>
<dd>Write a list of all processes
that have expired and not been respawned by the
<i>init</i>
system process.
The
&lt;<i>exit</i>&gt;
field appears for dead processes and contains the termination and exit
values of the dead process.
This can be useful in determining why a process terminated.

<dt><b>-H</b>
<dd>Write column headings above the regular output.

<dt><b>-l</b>
<dd>(The letter ell.)
List only those lines on which the system is waiting
for someone to login.
The
&lt;<i>name</i>&gt;
field is
<b>LOGIN</b>
in such cases.
Other fields are the same as for user entries except that the
&lt;<i>state</i>&gt;
field does not exist.

<dt><b>-m</b>
<dd>Output only information
about the current terminal.

<dt><b>-p</b>
<dd>List any other process that is currently active and has
been previously spawned by
<i>init</i>.

<dt><b>-q</b>
<dd>(Quick.)
List only the names and the number of users currently logged on.
When this option is used, all other options are ignored.

<dt><b>-r</b>
<dd>Write the current
<i>run-level</i>
of the
<i>init</i>
process.

<dt><b>-s</b>
<dd>List only the
&lt;<i>name</i>&gt;,
&lt;<i>line</i>&gt;
and
&lt;<i>time</i>&gt;
fields.
This is the default case.

<dt><b>-t</b>
<dd>Indicate the last change to the system clock.

<dt><b>-T</b>
<dd>Show the state of each terminal,
as described in the STDOUT section.

<dt><b>-u</b>
<dd>This option lists only those users who are currently logged in.
Output the user's &quot;idle time&quot; in
addition to any other information.
The idle time is the time
since any activity occurred on the user's terminal.
The method of determining this is unspecified.
The
&lt;<i>name</i>&gt;
is the user's login name.
The
&lt;<i>line</i>&gt;
is the name of the line as found in the directory
<b>/dev</b>.
The
&lt;<i>time</i>&gt;
is the time that the user logged in.
The
&lt;<i>activity</i>&gt;
is the number of hours and minutes since activity last occurred on
that particular line.
A dot
indicates that the terminal has seen activity in the last minute
and is therefore &quot;current.&quot;
If more than twenty-four hours have elapsed or
the line has not been used since boot time,
the entry is marked
&lt;old&gt;.
This field is useful when trying to determine
whether a person is working at the terminal or not.
The
&lt;<i>pid</i>&gt;
is the process ID of the user's login process.

</dl>
</blockquote><h4><a name = "tag_001_014_2889">&nbsp;</a>OPERANDS</h4><blockquote>
The following operands are supported:
<dl compact>

<dt><b>am&nbsp;i</b><dd>
<dt><b>am&nbsp;I</b><dd>In the POSIX locale, limit the output
to describing the invoking user, equivalent to the
<b>-m</b>
option.
The
<b>am</b>
and
i
or
I
must be separate arguments.

<dt><i>file</i><dd>Specify a pathname of a file to substitute for
the implementation-dependent database of logged-on users that
<i>who</i>
uses by default.

</dl>
</blockquote><h4><a name = "tag_001_014_2890">&nbsp;</a>STDIN</h4><blockquote>
Not used.
</blockquote><h4><a name = "tag_001_014_2891">&nbsp;</a>INPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2892">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>who</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.

<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments).

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>LC_TIME</i><dd>
Determine the locale used for the format and contents
of the date and time strings.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_2893">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_2894">&nbsp;</a>STDOUT</h4><blockquote>
The
<i>who</i>
utility writes its default information to the standard output in
the following general format:
<pre>
<code>
&lt;<i>name</i>&gt;<b>[</b>&lt;<i>state</i>&gt;<b>]</b>&lt;<i>line</i>&gt;&lt;<i>time</i>&gt;<b>[</b>&lt;<i>activity</i>&gt;<b>][</b>&lt;<i>pid</i>&gt;<b>][</b>&lt;<i>comment</i>&gt;<b>][</b>&lt;<i>exit</i>&gt;<b>]
</b></code>
</pre>
<p>
The following format is used for the
<b>-T</b>
option:
<p><code>
<pre>
<tt>"%s %c %s %s\n"</tt>, &lt;<i>name</i>&gt;,
&lt;<i>terminal&nbsp;state</i>&gt;,
&lt;<i>terminal&nbsp;name</i>&gt;,
&lt;<i>time&nbsp;of&nbsp;login</i>&gt;
</pre>
</code>
where
&lt;<i>terminal&nbsp;state</i>&gt;
is one of the following characters:
<dl compact>

<dt><b>+</b><dd>The terminal allows write access to other users.

<dt><b>-</b><dd>The terminal denies write access to other users.

<dt><b>?</b><dd>The terminal write-access state cannot be determined.

</dl>
<p>
In the POSIX locale, the
&lt;<i>time&nbsp;of&nbsp;login</i>&gt;
is equivalent in format to the output of:
<pre>
<code>
date +"%b %e %H:%M"
</code>
</pre>
<p>
If the
<b>-u</b>
option is used with
<b>-T</b>,
the idle time is added to the end of the previous format
in an unspecified format.
</blockquote><h4><a name = "tag_001_014_2895">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_2896">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2897">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2898">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>Successful completion.

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_2899">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_2900">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The name
<i>init</i>
used for the system process is the most commonly used
on historical systems, but it may vary.
<p>
The &quot;domain of accessibility&quot; referred to is a
broad concept that permits interpretation either on a very secure basis
or even to allow a network-wide
implementation like the historical
</blockquote><h4><a name = "tag_001_014_2901">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2902">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2903">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="mesg.html">mesg</a></i>.
<br>
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
